@if(auth()->user()->id === 1)
    <div class="form-group">
        <label for="tagUid" class="col-md-2 control-label">所属用户</label>
        <div class="col-md-2">
            <select class="form-control" name="uid" id="tagUid"
                    onchange="$('#username').val($(this).find('option:selected').text());">
                @foreach ($userList as $user_id=>$login_name)
                    <option value="{{ $user_id }}" @if ($user_id === $uid) selected="selected" @endif>{{ $login_name }}</option>
                @endforeach
            </select>
            <input type="hidden" id="username" name="username" value="{{ empty($username) ? $userList[1] : $username}}">
        </div>
    </div>
@else
    <input type="hidden" id="uid" name="uid" value="{{auth()->user()->id}}">
    <input type="hidden" id="username" name="username" value="{{auth()->user()->name}}">
@endif
<div class="form-group">
    <label for="tagName" class="col-md-2 control-label">模板名称</label>
    <div class="col-md-10">
        <input type="text" id="tagName" class="form-control" name="name" value="{{ $name}}" autofocus>
    </div>
</div>

<div class="form-group">
    <label for="tagMark" class="col-md-2 control-label">备注</label>
    <div class="col-md-10">
        <textarea id="tagMark" name="mark" class="form-control" rows="3">{{$mark}}</textarea>
    </div>
</div>

<div class="form-group"> 
    <label for="tagSourceCode" class="col-md-2 control-label">模板内容</label>
    <div class="col-md-10">
		<textarea id="tagSourceCode" name='source_code'>{{$source_code}}</textarea>
    </div>
</div>

@section('js')
    <script src="/plugins/ckeditor/ckeditor_standard/ckeditor.js"></script>
    <script type="text/javascript">
        CKEDITOR.replace('source_code',{ fullPage: true, allowedContent: true,startupMode:'source'});
    </script>
@stop

